const path = require('path')
const { IgnorePlugin } = require('webpack')
function resolve(dir) {
  // path.join()方法用于连接路径
  return path.join(__dirname, dir)
}

module.exports = {
  devServer: {
    // 自动打开
    open: true,
    // port: 9527  可以更改端口
    proxy: {
      '/api': {
        // target: 'http://hsapi.ms-cloud.cn',
        // target: 'http://192.168.3.2:8760',
        target: 'http://192.168.3.245:8760',
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  },
  css: {
    loaderOptions: {
      less: {
        javascriptEnabled: true
      }
    }
  },
  publicPath: '/',
  configureWebpack: {
    plugins: [new IgnorePlugin(/^\.\/locale$/, /moment$/)]
  }
}
